<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
  
</head>
<body>
   <div style="margin:0;padding:0;width:200px; transform: translateY(50%)" data-index="0" data-uname="xiaoxiao" data-zhuiMeng="追梦" data-je-ffrey="jeffrey">777777777</div>
   <span>2222222222</span>
</body>
<script>
const divDom=document.querySelector("div")
divDom.dataset.sex="女" //正确写法
divDom.dataset.setACss = "设置css样式";//正确写法
divDom.dataset.xxx={}
divDom.dataset.qasd=function(){}
divDom.dataset.fcd=10
divDom.dataset.qwe='[1,2,3,4]'
// divDom.dataset['index-qw'] = "asd"; //错误写法
console.dir(divDom)
divDom.setAttribute("stey",0)
console.log(divDom,divDom.dataset,divDom.dataset.setACss,divDom.getAttribute("stey"),JSON.parse(divDom.dataset.qwe));


</script>
</html>
<style>
    /* 对元素的padding margin设置百分数值：百分数是相对于父元素的width来计算的 */
    
</style>